<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Maintain Hotels</title>
	<link rel="stylesheet" href="register.css" type="text/css" media="all"/>
</h:head>

<h:body style="background-image: url(images/templatemo_body.jpg) " >
	<p style="font-size: xx-large; font-family: Arial, Helvetica, sans-serif; color: #CC0000">MAINTAIN HOTELS</p>
	<p:button outcome="manageHotel" value="BACK" icon="ui-icon-arrowreturnthick-1-w"/>
			
	<br />
	<div>
			
			<h:form id="form">  
			
			<p:growl id="messages" showDetail="true"/>  
		  
		    <p:dataTable var="hotel" value="#{listBean.getHotelModel()}" id="hotelList" editable="true"  >  
		  
		        <f:facet name="header">  
		            Editing  
		        </f:facet>  
		  
		        <p:ajax event="rowEdit" listener="#{listBean.onEditHotel}" update=":form:messages" />  
		        <p:ajax event="rowEditCancel" listener="#{listBean.onCancel}" update=":form:messages" />  
		  
		        <p:column headerText="HotelID" style="width:8%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.hotelID}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.hotelID}" style="width:100%"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>  
		  
		        <p:column headerText="Name" style="width:15%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.name}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.name}" style="width:100%" label="Name"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>  
		        
		        <p:column headerText="Street Name" style="width:20%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.streetName}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.streetName}" style="width:100%" label="StreetName"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>
		        
		        <p:column headerText="Street Number" style="width:15%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.streetNumber}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.streetNumber}" style="width:100%" label="StreetNumber"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>
		        
		        <p:column headerText="Place of Location" style="width:20%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.arrivalPlace}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.arrivalPlace}" style="width:100%" label="ArrivalPlace"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>
		        
		        <p:column headerText="Classification" style="width:15%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.classification}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.classification}" style="width:100%" label="Classification"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>
		  
		 		<p:column headerText="Cost (€)" style="width:10%">  
		            <p:cellEditor>  
		                <f:facet name="output">  
		                    <h:outputText value="#{hotel.cost}" />  
		                </f:facet>  
		                <f:facet name="input">  
		                    <p:inputText value="#{hotel.cost}" style="width:100%" label="Cost"/>  
		                </f:facet>  
		            </p:cellEditor>  
		        </p:column>
		        
		        <p:column style="width:4%">  
		            <p:rowEditor />  
		        </p:column> 
		        
		        <p:column style="width:6%">  
               		<p:commandButton id="selectButton" actionListener="#{productBean.deleteHotel(hotel)}" icon="ui-icon-trash" title="View" update=":form:messages :form:hotelList"> 
     						<f:setPropertyActionListener value="#{hotel}" target="#{listBean.selectedHotel}" />  
           			</p:commandButton>   
        		</p:column> 
		  
		    </p:dataTable>  
		  
		</h:form>
			  </div>
</h:body>
</html>